import {
    a as createElementBlock,
    ag as __unplugin_components_0,
    b as createBaseVNode,
    d as defineComponent,
    e as ref,
    I as renderSlot,
    J as mergeModels,
    k as createCommentVNode,
    m as useModel,
    n as normalizeClass,
    o as openBlock,
    q as createVNode,
    t as toDisplayString,
    U as watchEffect,
    v as createTextVNode
} from "./index-Dfdf_Rjk.js";

const _hoisted_1$2 = {class: "flex-center flex-col gap-1 color-fade"};
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
    __name: "Empty",
    props: {
        icon: {}
    },
    setup(__props) {
        return (_ctx, _cache) => {
            return openBlock(), createElementBlock("div", _hoisted_1$2, [
                _ctx.icon ? (openBlock(), createElementBlock("div", {
                    key: 0,
                    class: normalizeClass(_ctx.icon)
                }, null, 2)) : createCommentVNode("", true),
                renderSlot(_ctx.$slots, "default", {}, () => [
                    _cache[0] || (_cache[0] = createTextVNode("暂无数据"))
                ])
            ]);
        };
    }
});
const _hoisted_1$1 = {class: "grid h-full place-content-center place-items-center gap-2 text-sm"};
const _hoisted_2$1 = {class: "color-fade"};
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
    __name: "Loading",
    props: {
        desc: {default: "正在加载"}
    },
    setup(__props) {
        return (_ctx, _cache) => {
            const _component_Spinner = __unplugin_components_0;
            return openBlock(), createElementBlock("div", _hoisted_1$1, [
                createVNode(_component_Spinner, {class: "mb-1 h-8 w-8"}),
                renderSlot(_ctx.$slots, "default", {}, () => [
                    createBaseVNode("span", _hoisted_2$1, toDisplayString(_ctx.desc), 1)
                ])
            ]);
        };
    }
});
const _hoisted_1 = ["open"];
const _hoisted_2 = {class: "block"};
const _hoisted_3 = {
    key: 0,
    class: "bg-base"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
    __name: "SimpleCollapse",
    props: /* @__PURE__ */ mergeModels({
        active: {type: Boolean},
        headerClass: {}
    }, {
        "modelValue": {
            default: false
        },
        "modelModifiers": {}
    }),
    emits: /* @__PURE__ */ mergeModels(["show"], ["update:modelValue"]),
    setup(__props, {emit: __emit}) {
        const emit = __emit;
        const open = useModel(__props, "modelValue");
        const hasShown = ref(open.value);
        if (!hasShown.value) {
            const stop = watchEffect(() => {
                if (open.value) {
                    emit("show");
                    hasShown.value = true;
                    stop();
                }
            });
        }
        return (_ctx, _cache) => {
            return openBlock(), createElementBlock("details", {
                open: open.value,
                class: normalizeClass(["relative border rounded-md", _ctx.active ? "border-primary-500" : "border-base"]),
                onToggle: _cache[0] || (_cache[0] = ($event) => open.value = $event.target.open)
            }, [
                createBaseVNode("summary", _hoisted_2, [
                    createBaseVNode("div", {
                        flex: "~ gap-2 items-center",
                        class: normalizeClass(["cursor-pointer select-none bg-hover p-2 text-0.9rem", _ctx.headerClass])
                    }, [
                        _cache[1] || (_cache[1] = createBaseVNode("div", {class: "i-ph:caret-right flex-none op50 [details[open]_&]:rotate-90"}, null, -1)),
                        renderSlot(_ctx.$slots, "title"),
                        _cache[2] || (_cache[2] = createBaseVNode("div", {class: "flex-auto"}, null, -1)),
                        renderSlot(_ctx.$slots, "actions")
                    ], 2)
                ]),
                hasShown.value ? (openBlock(), createElementBlock("div", _hoisted_3, [
                    renderSlot(_ctx.$slots, "default")
                ])) : createCommentVNode("", true)
            ], 42, _hoisted_1);
        };
    }
});
export {
    _sfc_main as _,
    _sfc_main$2 as a,
    _sfc_main$1 as b
};
